package com.maint.m

import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.POST

interface TicketApiService {
    @POST("iot/operationTicket/page")
    fun getTicketPage(@Body params: PageRequest): Call<OperationTicketResponse>

    @POST("iot/operationTicket/get")
    fun getTicketDetail(@Body request: TicketDetailRequest): Call<TicketDetailResponse>


    @POST("iot/operationTicket/save")
    fun saveTicket(@Body params: SaveRequest): Call<SaveTicketResponse>

    @POST("iot/operationTicket/updateStatus")
    fun updateTicketStatus(@Body params: UpdateStatusRequest): Call<SaveTicketResponse>
}

data class PageRequest(
    val pageNum: Int,
    val pageSize: Int
)

data class SaveRequest(
    var stationName: String,
    val unit: String,  // 编号
    val dispatchOrderNumber: String,  // 站名
    val serialNumber: String,  // 单位
    val operationTask: String,   // 操作任务
    val operationItem: List<String>,  // 操作项目
)

data class TicketDetailRequest(val id: String)

data class UpdateStatusRequest(
    val id: String,
    val status: String
)